ps -fe|grep codec.exe |grep -v grep
if [ $? -ne 0 ]
then
	/root/codec.exe &
	sleep 1
	ps -fe|grep pushstream.exe |grep -v grep	
	if [ $? -ne 0 ]
	then
		/root/pushstream.exe &
	fi
	ps -fe|grep gb28181 |grep -v grep
	if [ $? -ne 0 ]
	then
			/root/gb28181 &
	fi

fi
ps -fe|grep mongoose |grep -v grep
if [ $? -ne 0 ]
then
       /root/mongoose &
fi
lsusb |grep 2ca3
if [  $? -eq 0 ];then
	echo "find 2ca3:0020"
	sleep 1s
	ps -fe|grep videocap |grep -v grep
	if [ $? -ne 0 ]
	then
		/root/videocap &
	fi

else
	ps -fe|grep videocap |grep -v grep
	if [ $? -eq 0 ]
	then
		kill -USR2 $(pidof videocap) 
	else
		/root/send_static_image &
	fi
fi
# done
if [ -e /dev/snd/controlC0 ]
then

	sleep 1
	ps -fe|grep alsacap |grep -v grep
	if [ $? -ne 0 ]
	then
		echo "****alsa start*****"
		/root/alsacap &
	fi		
else
				
	ps -fe|grep alsacap |grep -v grep
	if [ $? -eq 0 ]
	then
		kill -USR2 $(pidof alsacap)
	fi

fi


